package com.component.domain.vo;

import com.component.enumitem.ModelSumTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.List;

/**
 * @Classname AddModelVo
 * @Description TODO
 * @Date 2023/10/23 15:32
 * @Created by XiongXiong
 * @Author: X.I.O
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AddModelVo {

    private Integer id;

    @NotBlank(message = "不允许为空")
    private String title;

    @NotNull(message = "不允许为空")
    private List<ModelVo> modelVos;

    private String sumType;

    public String getSumType(){
        if (sumType == null) {
            return ModelSumTypeEnum.DAY_SUM_TYPE_ENUM.getType();
        }
        return sumType;
    }

    private List<String> hanSumFields;

    private List<String> lieSumFields;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<ModelVo> getModelVos() {
        if(this.modelVos==null){
            return Collections.emptyList();
        }
        return modelVos;
    }

    public void setModelVos(List<ModelVo> modelVos) {
        this.modelVos = modelVos;
    }

    public List<String> getHanSumFields() {
        if(this.hanSumFields==null){
            return Collections.emptyList();
        }
        return hanSumFields;
    }

    public void setHanSumFields(List<String> hanSumFields) {
        this.hanSumFields = hanSumFields;
    }

    public List<String> getLieSumFields() {
        if(this.lieSumFields==null){
            return Collections.emptyList();
        }
        return lieSumFields;
    }

    public void setLieSumFields(List<String> lieSumFields) {
        this.lieSumFields = lieSumFields;
    }
}
